<?php

namespace App\Http\Resources\Admin;

use Illuminate\Http\Resources\Json\Resource;

class OrderItem extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'product_price' => $this->product_price,
            'product_unit' => $this->product_unit,
            'product_count' => $this->product_count,
            'product_id' => $this->product_id,
            'product_name' => $this->product_name,
            'product_pic' => $this->product_pic,
            'product_pic_url' => config('app.url') . $this->product_pic,
            'product_spec' => $this->product_spec,
            'product_info' => $this->product_info,
            'product_address' => $this->product_address
        ];
    }
}
